package com.telecomyt.jwportal.activity.message.adapter;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ruffian.library.widget.RTextView;
import com.telecomyt.jwportal.R;
import com.telecomyt.jwportal.activity.message.bean.MessageBean;

import java.util.Random;

/**
 * @author created by chengDa
 * @time 2020/9/7  10:11
 * @description
 */
public class MessageAdapter extends BaseQuickAdapter<MessageBean, BaseViewHolder> {
    public MessageAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageBean item) {
        RTextView textView = helper.getView(R.id.mRTextView);
        textView.setText(item.getMessage());
        Random random = new Random();
        int color = Color.argb(255, random.nextInt(256), random.nextInt(256), random.nextInt(256));
        textView.getHelper().setBackgroundColorNormal(color);



    }
}
